// 作业题：抽象类与多接口实现
// 定义：
// ● 抽象类 Employee，包含抽象方法 getSalary(): number
// ● 接口 Identifiable，包含属性 id: number
// ● 接口 Department，包含属性 department: string
// 创建类 Engineer 继承 Employee 并实现 Identifiable 和 Department：
// ● 属性：id, name, department, hourlyRate, hoursWorked
// ● 实现 getSalary()：返回 hourlyRate * hoursWorked
// 实例化 Engineer 并打印其 id、department 和 salary。

abstract class Employee {
    abstract getSalary(): number;
}

interface Identifiable {
    id: number;
}

interface Department {
    department: string;
}

class Engineer extends Employee implements Identifiable, Department {
    id: number;
    name: string;
    department: string;
    hourlyRate: number;
    hoursWorked: number;

    constructor(id: number, name: string, department: string, hourlyRate: number, hoursWorked: number) {
        super();
        this.id = id;
        this.name = name;
        this.department = department;
        this.hourlyRate = hourlyRate;
        this.hoursWorked = hoursWorked;
    }

    getSalary(): number {
        return this.hourlyRate * this.hoursWorked;
    }
}

let engineer = new Engineer(1, "张三", "开发", 20, 40);
console.log(engineer.id);
console.log(engineer.department)
console.log(engineer.getSalary());
